<template>
  <div class="production-minor">
    <el-row class="row" :gutter="10">
      <el-col :md="8" :sm="24" :xs="24" class="col">
        <card :title-size="cardTitleSize" title="设备维护提示" :isCenter="true" :height="cardHeight">
          <equipTips />
        </card>
      </el-col>
      <el-col :md="8" :sm="24" :xs="24" class="col">
        <card :title-size="cardTitleSize" title="各产品生产占比" :height="cardHeight">
          <productionPipChart />
        </card>
      </el-col>
      <el-col :md="8" :sm="24" :xs="24" class="col">
        <card :title-size="cardTitleSize" title="生产任务完成情况" :isCenter="true" :height="cardHeight">
          <production-progress :percentage="progressData.finishRate" :text="`生产任务量${progressData.totalNum}`" />
        </card>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import equipTips from './equipTips.vue';
import productionPipChart from './productionPipChart.vue';
import productionProgress from './productionProgress.vue';
import { getTask } from '@/api/home';
export default {
  components: {
    equipTips,
    productionPipChart,
    productionProgress,
  },
  data() {
    return {
      cardTitleSize: 16,
      cardHeight: 400,
      progressData: {},
    };
  },
  created() {
    this.getTaskFinishSchedule();
  },
  methods: {
    getTaskFinishSchedule() {
      const { projectId } = this.$store.getters;
      getTask({ projectId }).then(res => {
        this.progressData = res.data || {};
      });
    },
  },
};
</script>
<style lang="scss" scoped></style>
